<extend name="../application/admin/view/common/base.html" />
<block name="body">
    <div class="layui-row">
        <form class="layui-form layui-col-md12 x-so">
            <input class="layui-input" placeholder="产品名称" name="name"  value="{$name|default=''}">
            <div class="layui-input-inline">
                <select class="layui-input" name="isNew">
                    <option value="-1">是否最新</option>
                        <option value="1" <if condition="$isNew eq 1">selected</if>>是</option>
                        <option value="1" <if condition="$isNew eq 0">selected</if>>不是</option>
                </select>
            </div>
            <div class="layui-input-inline">
                <select class="layui-input" name="isHot">
                    <option value="-1">是否最热</option>
                    <option value="1" <if condition="$isHot eq 1">selected</if>>是</option>
                    <option value="1" <if condition="$isHot eq 0">selected</if>>不是</option>
                </select>
            </div>
            <input class="layui-input" placeholder="添加时间开始" name="beginTime" id="start" value="{$beginTime|default=''}" readonly>
            <input class="layui-input" placeholder="添加时间截止" name="endTime" id="end" value="{$endTime|default=''}" readonly>
            <button class="layui-btn"  lay-submit="" lay-filter="sreach"><i class="layui-icon">&#xe615;</i></button>
            <button class="layui-btn layui-btn-primary" type="button" onclick="window.location.href='?'"><i class="iconfont">&#xe631;</i></button>
        </form>
    </div>
    <xblock>
        <button class="layui-btn" onclick="x_admin_show('添加','/admin/product.add')"><i class="layui-icon"></i>添加产品</button>
        <span class="x-right" style="line-height:40px">共有数据：{$count} 条</span>
    </xblock>
    <table class="layui-table">
        <thead>
        <tr>
            <th>
                <div class="layui-unselect header layui-form-checkbox" lay-skin="primary"><i class="layui-icon">&#xe605;</i></div>
            </th>
            <th>ID</th>
            <th>名称</th>
            <th>icon</th>
            <th>贷款额度</th>
            <th>链接地址</th>
            <th>下款时间</th>
            <th>审核时间</th>
            <th>日利率</th>
            <th>点击次数</th>
            <th>标签</th>
            <th>创建时间</th>
            <th>操作</th>
        </thead>
        <tbody>
        <foreach name="list" item="vo">
            <tr>
                <td>
                    <div class="layui-unselect layui-form-checkbox" lay-skin="primary" data-id='{$vo.id}'><i class="layui-icon">&#xe605;</i></div>
                </td>
                <td>{$vo.id}</td>
                <td>{$vo.name}</td>
                <td>
                    <if condition="$vo.icon neq ''">
                        <a href="{$vo.icon}" target="_blank">
                            <img style="width:40px;height:20px;" src="{$vo.icon}" onMouseOver="toolTip('{$vo.icon}')" onMouseOut="toolTip()"/>
                        </a>
                    </if>
                    <img src=""></td>
                <td>{$vo.quota}</td>
                <td>{$vo.link}</td>
                <td>{$vo.term}</td>
                <td>{$vo.loanTime}</td>
                <td>{$vo.interestRate}</td>
                <td>{$vo.clickCount}</td>
                <td>
                    <div class="layui-form">
                        <input class="layui-form-checkbox" lay-skin="primary" type="checkbox" name="isNew" title="最新" <if condition="$vo.isNew eq 1">checked</if>>
                    </div>
                    <br>
                    <div class="layui-form">
                        <input class="layui-form-checkbox" lay-skin="primary" type="checkbox" name="isHot" title="最热" <if condition="$vo.isHot eq 1">checked</if>>
                    </div>

                </td>
                <td>{$vo.created}</td>
                <td>
                    <a href="javascript:;" onclick="x_admin_show('编辑','/admin/product.edit?id={$vo.id}')">编辑</a>
                    <a href="javascript:;" onclick="opmsg('/admin/product.del?id={$vo.id}','删除')">删除</a>
                </td>
            </tr>
        </foreach>
        </tbody>
    </table>
    <div class="page">
        {$page|raw}
    </div>
</block>

<block name="bottom">
    <script type="text/javascript" src="/static/lib/ToolTip/ToolTip.js"></script>
    <script type="text/javascript">
        layui.use('laydate', function(){
            var laydate = layui.laydate;

            //执行一个laydate实例
            laydate.render({
                elem: '#start' //指定元素
            });

            //执行一个laydate实例
            laydate.render({
                elem: '#end' //指定元素
            });
        });
    </script>
</block>